import React, {Component} from "react";
import {BrowserRouter as Router, Route, Redirect} from "react-router-dom";
import AppIndex from "../index/AppIndex";
import RuYaoSLYCLHXFXBGD from "../Table/RuYaoSLYCLHXFXBGD/RuYaoSLYCLHXFXBGD";
import ChuMoSLYCLHXFXBGD from "../Table/ChuMoSLYCLHXFXBGD/ChuMoSLYCLHXFXBGD";
import KongZhiShiYSJL from "../Table/KongZhiShiYSJL/KongZhiShiYSJL";
import ShengShuYLQFXHZB from "../Table/ShengShuYLQFXHZB/ShengShuYLQFXHZB";
import ZhongKongSSCXTJL from "../Table/ZhongKongSSCXTJL/ZhongKongSSCXTJL";
import ZhongKongSSCXTJLX2 from "../Table/ZhongKongSSCXTJLX2/ZhongKongSSCXTJLX2";
import UserManage from "../Table/Manage/UserManage";
import BiaoZhun from "../Table/BiaoZhun/BiaoZhun";
import ChaKan from "../Table/ChaKan/ChaKan";
import Login from "../Login/Login";
import Registration from '../reg/reg.js';
// import Imessage1 from '../Component/Imessage1';
// import Imessage2 from '../Component/Imessage2';
// import Imessage3 from '../Component/Imessage3';
import Home_app from "../Component/Home_app";

export default class AppRouter extends Component {

    render() {
        return (
            <Router>
                <div>
                    <Route path='/' exact render={() => (
                        <Redirect to='/index'/>
                    )}/>
                    <Route path="/index" component={Home_app}/>
                    <Route path="/login" component={Login}/>
                    <Route path="/RuYaoSLYCLHXFXBGD" component={RuYaoSLYCLHXFXBGD} onEnter={this.isLogin} />
                    <Route path="/ChuMoSLYCLHXFXBGD" component={ChuMoSLYCLHXFXBGD} onEnter={this.isLogin}/>
                    <Route path="/KongZhiShiYSJL" component={KongZhiShiYSJL} onEnter={this.isLogin}/>
                    <Route path="/ShengShuYLQFXHZB" component={ShengShuYLQFXHZB} onEnter={this.isLogin}/>
                    <Route path="/ZhongKongSSCXTJL" component={ZhongKongSSCXTJL} onEnter={this.isLogin}/>
                    <Route path="/ZhongKongSSCXTJLX2" component={ZhongKongSSCXTJLX2} onEnter={this.isLogin}/>
                    <Route path="/UserManage" component={UserManage} onEnter={this.isLogin}/>
                    <Route path="/BiaoZhun" component={BiaoZhun} onEnter={this.isLogin}/>
                    <Route path="/ChaKan" component={ChaKan} onEnter={this.isLogin}/>
                    <Route path="/reg" component={Registration} onEnter={this.isLogin}/>
                </div>
            </Router>
        );
    }
}
